// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

import AutomaticRecode from "../../Commons/AutomaticRecode";
import SkillManager from "./SkillManager";
import SkillTemplate from "./SkillTemplate";


export default class SkillEntity extends AutomaticRecode {

    public id: number;
    public level: number;


    get skillTp(): SkillTemplate {
        return SkillManager.single.getSkillTemplate(this.id);
    }

    get skillDescribe(): string {
        return this.skillTp.skillDescribe;
    }

    get upgradeGoldNum(): number {
        return this.level * this.level * 10 + 10 * this.level + this.skillTp.unlockCost;
    }

    get valueNum(): number {
        return this.level * this.skillTp.upgradeGrow;
    }
}
